<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>Document</title>
</head>

<body>
    <div id="info"></div>
    <script type="text/javascript" src="./lib/jquery.js"></script>
    <script type="text/javascript" src="./lib/template-web.js"></script>
    <script id="template" type="text/html">
        <div>姓名：{{name}}</div>
        <div>年龄：{{age}}</div>
        {{if gender==0}}
        <div>性别：女</div>
        {{else if gender==1}}
        <div>性别：男</div>
        {{else}}
        <div>性别：不确定</div>
        {{/if}}
        <div>分数：{{@score}}</div>
    </script>
    <script>
        var people = {
            name: "韩山",
            age: 18,
            gebder: 3,
            score: "<h1>1000</h1>",
        };
        var str = template("template", people);
        $("#info").html(str);
    </script>
</body>

</html>